import npfnn


class ZhnNet1(npfnn.Module):
    def __init__(self):
        super(ZhnNet1, self).__init__()
        self.conv1 = npfnn.Conv2d(3, 12, padding=1)
        self.conv2 = npfnn.Conv2d(12, 24, padding=1)
        self.relu = npfnn.LeakyReLU(negative_slope=0.1)
        self.pool = npfnn.MaxPool2d(2, stride=2)
        self.linear = npfnn.Linear(115200, 1)

    def forward(self, x):
        x = self.conv1(x)
        x = self.relu(x)
        x = self.pool(x)
        x = self.conv2(x)
        x = self.relu(x)
        x = self.pool(x)
        x = x.reshape(-1)
        x = self.linear(x)
        return x
